package com.newtouch.ainsurtech.repository.demo;/**
 * Created by jovi on 25/09/2017.
 */

import com.newtouch.ainsurtech.entity.demo.PersonEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: Copyright (c) 2016
 * All rights reserved. 2017-09-25 17:50
 * </p>
 *
 * @author MaoJiaWei
 * @version 1.0
 */
@Repository
@Transactional
public interface PersonEntityRepository extends JpaRepository<PersonEntity,Long> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    PersonEntity findById(Long id);

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    Page<PersonEntity> findAllByName(String name,Pageable pageable);
}
